import java.util.Scanner;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2022/10/20 17:40
 * 最近公共祖先
 * 求最大连续bit数
 */
public class Day11 {
    public static void main(String[] args) {
//        System.out.println(getLCA(2,6));
        // * 求最大连续bit数
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int max = 0;
            String str = Integer.toBinaryString(n);
            String[] strings = str.split("0");
            for (int i = 0; i < strings.length; i++) {
                if (strings[i].length() > max) {
                    max = strings[i].length();
                }
            }
            System.out.println(max);
        }
    }

    // * 最近公共祖先
    public static int getLCA(int a, int b) {
        // write code here
        while (a != b) {
            if (a > b) {
                a /= 2;
            } else {
                b /= 2;
            }
        }
        return a;
    }
}
